package com.itheima;

import com.itheima.config.SpringConfig;
import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.service.ProductService;
import com.itheima.service.UserService;
import com.itheima.xyz.X;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-06 09:20
 * @description
 */
public class Test01 {
    public static void main(String[] args) {
        //你创建另外容器对象的子类
        //基于注解的容器类
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);


        UserService userService = context.getBean(UserService.class);
        System.out.println("使用全注解方式获取:"+userService);


    }
}
